<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('contract列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>订单号：</label>
                                <input type="text" name="insuranceNumber"/>
                            </li>
                            <li>
                                <label>投保日期：</label>
                                <input type="text" class="time-input" placeholder="请选择投保日期" name="insuredDate"/>
                            </li>
<!--                            <li>-->
<!--                                <label>生效日期：</label>-->
<!--                                <input type="text" class="time-input" placeholder="请选择生效日期" name="startDate"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>失效日期：</label>-->
<!--                                <input type="text" class="time-input" placeholder="请选择失效日期" name="endingDate"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>业务员代码：</label>-->
<!--                                <input type="text" name="userStaffCode"/>-->
<!--                            </li>-->
                            <li>
                                <label>业务员姓名：</label>
                                <input type="text" name="userName"/>
                            </li>
                            <li>
                                <label>投保人姓名：</label>
                                <input type="text" name="applicantName"/>
                            </li>
<!--                            <li>-->
<!--                                <label>投保人证件类型：</label>-->
<!--                                <select name="applicantIdType" th:with="type=${@dict.getType('id_type')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>投保人证件号：</label>-->
<!--                                <input type="text" name="applicantId"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>投保人国籍：</label>-->
<!--                                <select name="applicantNationality" th:with="type=${@dict.getType('nationality')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>投保人现住址：</label>-->
<!--                                <input type="text" name="applicantSite"/>-->
<!--                            </li>-->
                            <li>
                                <label>被保人姓名：</label>
                                <input type="text" name="recognizeeName"/>
                            </li>
<!--                            <li>-->
<!--                                <label>被保人证件类型：</label>-->
<!--                                <select name="recognizeeIdType" th:with="type=${@dict.getType('id_type')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>被保人证件号：</label>-->
<!--                                <input type="text" name="recognizeeId"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>被保人国籍：</label>-->
<!--                                <select name="recognizeeNationality" th:with="type=${@dict.getType('nationality')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>被保人现住址：</label>-->
<!--                                <input type="text" name="recognizeeSite"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>险种编码：</label>-->
<!--                                <input type="text" name="insuranceCode"/>-->
<!--                            </li>-->
                            <li>
                                <label>险种名称：</label>
                                <input type="text" name="insuranceName"/>
                            </li>
<!--                            <li>-->
<!--                                <label>保费：</label>-->
<!--                                <input type="text" name="insuranceExpense"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>保额：</label>-->
<!--                                <input type="text" name="insuranceQuota"/>-->
<!--                            </li>-->
                            <li>
                                <label>合同状态：</label>
                                <select name="status">
                                    <option value=""></option>
                                    <option value="1">问题件修改</option>
                                    <option value="2">新单复核</option>
                                    <option value="3">人工核保</option>
                                    <option value="4">签单完毕</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="insurance:contract:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="insurance:contract:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="insurance:contract:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="insurance:contract:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('insurance:contract:edit')}]];
        var removeFlag = [[${@permission.hasPermi('insurance:contract:remove')}]];
        var applicantIdTypeDatas = [[${@dict.getType('id_type')}]];
        var applicantNationalityDatas = [[${@dict.getType('nationality')}]];
        var recognizeeIdTypeDatas = [[${@dict.getType('id_type')}]];
        var recognizeeNationalityDatas = [[${@dict.getType('nationality')}]];
        var prefix = ctx + "insurance/contract";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                checkUrl: prefix + "/check/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "合同信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'insuranceNumber',
                    title: '订单号'
                },
                {
                    field: 'insuredDate',
                    title: '投保日期'
                },
                {
                    field: 'startDate',
                    title: '生效日期'
                },
                {
                    field: 'endingDate',
                    title: '失效日期'
                },
                {
                    field: 'userStaffCode',
                    title: '业务员代码',
                    visible: false
                },
                {
                    field: 'userName',
                    title: '业务员姓名'
                },
                {
                    field: 'applicantName',
                    title: '投保人姓名'
                },
                {
                    field: 'applicantIdType',
                    title: '投保人证件类型',
                    visible: false,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(applicantIdTypeDatas, value);
                    }
                },
                {
                    field: 'applicantId',
                    title: '投保人证件号',
                    visible: false
                },
                {
                    field: 'applicantNationality',
                    title: '投保人国籍',
                    visible: false,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(applicantNationalityDatas, value);
                    }
                },
                {
                    field: 'applicantSite',
                    title: '投保人现住址',
                    visible: false
                },
                {
                    field: 'recognizeeName',
                    title: '被保人姓名'
                },
                {
                    field: 'recognizeeIdType',
                    title: '被保人证件类型',
                    visible: false,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(recognizeeIdTypeDatas, value);
                    }
                },
                {
                    field: 'recognizeeId',
                    title: '被保人证件号',
                    visible: false
                },
                {
                    field: 'recognizeeNationality',
                    title: '被保人国籍',
                    visible: false,
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(recognizeeNationalityDatas, value);
                    }
                },
                {
                    field: 'recognizeeSite',
                    title: '被保人现住址',
                    visible: false
                },
                {
                    field: 'insuranceCode',
                    title: '险种编码',
                    visible: false
                },
                {
                    field: 'insuranceName',
                    title: '险种名称'
                },
                {
                    field: 'insuranceExpense',
                    title: '保费',
                    visible: false
                },
                {
                    field: 'insuranceQuota',
                    title: '保额',
                    visible: false
                },
                // {
                //     field: 'status',
                //     title: '合同状态'
                // },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>